
<style>

    .default,.blue{
        box-shadow: none;
        border: 1px solid;
        text-decoration: none;
        color: #fff;
        display: inline-block;
        padding: 6px 12px;
        margin-bottom: 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        -ms-touch-action: manipulation;
        touch-action: manipulation;
        cursor: pointer;
    }
    .blue{
        background: #3c8dbc;
        color: #fff;
    }
    .default{
        background: #999;
    }
</style>




<div class="x-body">
    <form class="layui-form form_single" id="form" action="{:url()}" method="post">
        <div class="layui-form-item">
            <label for="username" class="layui-form-label">
                用户名
            </label>
            <div class="layui-input-block">
                <textarea id="username" class="layui-textarea" name="username"     rows="10" placeholder="会员账号或者手机号 1个账号一行记录 "></textarea>
            </div>
            <!--<div class="layui-form-mid layui-word-aux">-->
            <!--(文章描述信息/简介)-->
            <!--</div>-->
        </div>

        <div class="layui-form-item">
            <label for="money" class="layui-form-label">
                生成金额
            </label>
            <div class="layui-input-block">
                <textarea id="money" class="layui-textarea" name="money"    rows="10" placeholder="生成金额 1个金额一行记录，行数要跟会员一致 "></textarea>
            </div>
            <!--<div class="layui-form-mid layui-word-aux">-->
            <!--(文章描述信息/简介)-->
            <!--</div>-->
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">
                商户标签
            </label>
            <div class="layui-input-block">
                <button type="button"  data-id="CCIE"  class="default"  >CCIE</button>
                <button type="button"  data-id="第三方平台"  class="default"  >第三方平台</button>
            </div>
            <input type="hidden" name="channel"  value="{$info['tags']|default=''}"/>


            <!--<div class="layui-form-mid layui-word-aux">-->
            <!--(文章描述信息/简介)-->
            <!--</div>-->
        </div>
        <div class="box-footer">
            {include file="layout/edit_btn_group"/}

        </div>

    </form>
</div>
<script>
    layui.use(['layer', 'form'], function(){
        layer=layui.layer;
        form = layui.form;
        //执行一个laydate实例
    });








</script>

<script>
    $("body").on('click','.default',function () {

        $(this).removeClass('default');
        $(this).addClass('blue');
        var len= $('.blue').length;
        var str='';
        for (var i=0; i<len;i++){
            if(i==0){
                str+=$('.blue').eq(i).attr('data-id');
            }else{
                str+=','+$('.blue').eq(i).attr('data-id');
            }

        }
        $("[name='channel']").val(str);

    })

    $("body").on('click','.blue',function () {
        $(this).removeClass('blue');
        $(this).addClass('default');
        var len= $('.blue').length;
        var str=',';
        for (var i=0; i<len;i++){
            if(i==0){
                str+=$('.blue').eq(i).attr('data-id');
            }else{
                str+=','+$('.blue').eq(i).attr('data-id');
            }
        }
        $("[name='channel']").val(str);

    })
</script>
